<?php
/* 
 * Copyright (c) 2018-2021   All rights reserved.
 *
 * 创建时间：2021-12-09 23:17:08
 *
 * 项目：/qq  -  $  - AdminQqController.php
 *
 * 作者：{{AUTO GENERATE}}
 */

//此文件使用程序自动生成，下次生成时【不会】覆盖。
//在这里可以补充、完善你的程序逻辑

namespace modules\qq\controllers;

use Lev;
use modules\qq\controllers\_gen\BaseAdminQq;
use modules\qq\table\qq\qqModelHelper;

!defined('INLEV') && exit('Access Denied LEV');

class BaseAdminQqMiddle extends BaseAdminQq
{

    public static function headerHtm()
    {
        return parent::headerHtm(); // TODO: Change the autogenerated stub
        //return '<tips class="gray inblk scale8">自定义headerHtm：文件位置：'.__DIR__ . '/AdminQqController.php'.'</tips>';
    }

    public static function footerHtm()
    {
        return parent::footerHtm(); // TODO: Change the autogenerated stub
        //return '<tips class="gray inblk scale8">自定义footerHtm</tips>';
    }

    public static function cardFooterButtons($btns = [])
    {
        return parent::cardFooterButtons($btns); // TODO: Change the autogenerated stub
        //return '<tips class="gray inblk scale8">自定义cardFooterButtons</tips>';
    }

    public static function headerViewHtm()
    {
        return parent::headerViewHtm(); // TODO: Change the autogenerated stub
        //return '<tips class="gray inblk scale8">自定义headerViewHtm：文件位置：'.__DIR__ . '/AdminQqController.php'.'</tips>';
    }

    public static function footerViewHtm()
    {
        return parent::footerViewHtm(); // TODO: Change the autogenerated stub
        //return '<tips class="gray inblk scale8">自定义footerViewHtm</tips>';
    }

    public static function col_qqstatus() {
        $arr = qqModelHelper::qqstatus();
        $arr[2] = '<absxn>'.$arr[2].'</absxn>';
        return $arr;
    }
}

class AdminQqController extends BaseAdminQqMiddle
{

    public static $tmpPath = 'admin-qq';
    public static $trash   = true;//是否允许删除数据
    public static $addurl  = false;//是否显示创建数据按钮
    public static $addRoute = 'Form_qq';//自定义创建数据表单地址 - 默认使用源表单

    public static $srhtitle    = '';//模糊搜索字段名称
    public static $srhkeyWhere = '';//模糊搜索sql语句 例：name LIKE '%{srhkey}%'

    public static $limit = 20;//每页显示多少条
    public static $order = ['id DESC'];//排序

    /**
     * 列表显示字段设置
     * 例：array(
    'id'           => array('order' => null, 'name' => 'Id', 'thattr' => 'wd30 nowrap', 'merge' => []),

    'name'         => array('order' => null, 'name' => '模块名称', 'thattr' => 'wd30 nowrap', 'merge' => ['addtime']),

    'displayorder' => array('order' => null, 'name' => '排序', 'thattr' => 'wd30 nowrap', 'merge' => []),

    'uptime'       => array('order' => null, 'name' => '更新时间', 'thattr' => 'wd30 nowrap', 'merge' => []),

    );
     *
     * order: 点击字段排序
     * name: 字段名称
     * thattr: 表格th属性，放class属性内，内容举例：wd30 nowrap" style="font-size:12px
     * merge: 合并显示，多个字段合并显示到一个上
     *
     * @see BaseAdminQq::showColumns();
     */
    public static function showColumns() {
        //return parent::showColumns(); // TODO: Change the autogenerated stub
        return array(
                //'id'       => array('order' => null, 'name' => 'Id', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'uid'      => array('order' => null, 'name' => '用户UID', 'thattr' => 'wd30 nowrap', 'merge' => []),

                //'suid'     => array('order' => null, 'name' => '三方站点用户UID', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'qq'       => array('order' => null, 'name' => 'QQ号', 'thattr' => 'wd30 nowrap', 'merge' => ['suid']),

                'qqnick'   => array('order' => null, 'name' => 'QQ昵称', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'qqpwd'    => array('order' => null, 'name' => 'QQ密码', 'thattr' => 'nowrap', 'merge' => ['loginmsg']),

                'descs'    => array('order' => null, 'name' => '备注', 'thattr' => 'wd30 nowrap', 'merge' => []),

                //'loginmsg' => array('order' => null, 'name' => '登陆返回信息', 'thattr' => 'wd30 nowrap', 'merge' => []),

                //'settings' => array('order' => null, 'name' => '通用设置', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'qqstatus' => array('order' => null, 'name' => 'QQ状态', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'status'   => array('order' => null, 'name' => '状态', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'uptime'   => array('order' => null, 'name' => '更新时间', 'thattr' => 'wd30 nowrap', 'merge' => []),

                //'addtime'  => array('order' => null, 'name' => '添加时间', 'thattr' => 'wd30 nowrap', 'merge' => []),

            );
    }

    /**
     *
     return [
        'showtype' => [
            //从上往下先到先得
            'input_{columnKey}'  => ['width'=>120,'textarea'=>1],//显示为无刷新更改字段
            'srhkey_{columnKey}' => ['or'=>['{columnKey}']],//显示为点击可搜索字段
            'status_{columnKey}' => 1,//显示为开关状态字段 status 自动
            'order_{columnKey}'  => 1,//显示为可排序输入框 含order关键字 自动
            'time_{columnKey}'   => 1,//显示为时间格式字段 含time关键字 自动
        ],
    ];
     *
     * @return array
     */
    public static function setColumnShowtype()
    {
        return parent::setColumnShowtype(); // TODO: Change the autogenerated stub
    }

    public static function formatListsv($sv, $lists)
    {
        $v = $sv;
        $sv = parent::formatListsv($sv, $lists); // TODO: Change the autogenerated stub
        return $sv;
    }

    public static function formatUid($sv, $lists, $srhkey = ['uid'])
    {
        return parent::formatUid($sv, $lists, $srhkey); // TODO: Change the autogenerated stub
    }

    public static function redirct($columnKey, $sv)
    {
        return parent::redirct($columnKey, $sv); // TODO: Change the autogenerated stub
    }

    public static function optButtons($sv)
    {
        return parent::optButtons($sv); // TODO: Change the autogenerated stub
    }

    public static function footerBtns($btns = [])
    {
        return parent::footerBtns($btns); // TODO: Change the autogenerated stub
    }

}